package it.clariter.connection;

import java.sql.Connection;
import java.sql.DriverManager;

public class MyConnection {

	public static String driver_name="com.mysql.jdbc.Driver";
	public static String connect_str="jdbc:mysql://localhost:3306/clariter_protocollo?user=root&password=root";

	public static Connection getConnection() throws Exception
	{   
		try
		{
			Connection c=null;
			Class.forName(driver_name);
			c=DriverManager.getConnection(connect_str);
			return c;
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
			throw ex;
		}
	}
	public static Connection createConnection() throws Exception
	{
		Connection c=null;
		try
		{
			Class.forName(driver_name);
			c=DriverManager.getConnection(connect_str);
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
			throw ex;
		}
		return c;
	}
}


